package middlewares

import (
	"github.com/kataras/iris"

	"im/admins/controller"
	"im/errcode"
)

func AdminUserVerify(ctx iris.Context) {
	authorization := ctx.GetHeader("Authorization")
	if authorization != "Bearer willnet2020" {
		var base = controller.Base{Ctx: ctx}
		base.SendCry(errcode.NewError(errcode.UnauthorizedOperation))
		return
	}
	ctx.Next()
}
